package com.study.elasticsearchstudy.service.impl;

import com.study.elasticsearchstudy.entity.Account;
import com.study.elasticsearchstudy.dao.AccountMapper;
import com.study.elasticsearchstudy.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class AccountServiceImpl implements AccountService{

	@Autowired
	AccountMapper accountMapper;

	/**
	 * 新增
	 * @param account
	 * @return
	 */
	@Override
	public int insert(Account account) {
		return accountMapper.insert(account);
	}

	 /**
	  * 批量新增
	  * @param accounts
	  */
	@Override
	public void insertBatch(List<Account> accounts) {
		accountMapper.insertBatch(accounts);
	}

	/**
	 * 根据主键删除
	 * @param id
	 * @return
	 */
	@Override
	public int deleteByPrimaryKey(Object id) {
		return accountMapper.deleteByPrimaryKey(id);
	}

	 /**
	  * 根据主键批量删除
	  * @param 
	  */
	@Override
	public void deleteBatch(List<Object> ids){
		accountMapper.deleteBatch(ids);
	}

	/**
	 * 根据主键更新
	 * @param account
	 * @return
	 */
	@Override
	public int update(Account account) {
		return accountMapper.update(account);
	}

	 /**
	  * 根据主键批量更新
	  * @param accounts
	  */
	@Override
	public void updateBatch(List<Account> accounts) {
		accountMapper.updateBatch(accounts);
	}

	/**
	 * 根据主键查找
	 * @param id 主键
	 * @return
	 */
	@Override
	public Account selectByPrimaryKey(Object id) {
		return accountMapper.selectByPrimaryKey(id);
	}

	 /**
	  * 根据条件查询一条数据
	  * @param account
	  */
	@Override
	public Account selectOne(Account account) {
		return accountMapper.selectOne(account);
	}

	/**
	 * 条件查询
	 * @param
	 * @return
	 */
	@Override
	public List<Account> selectList(Account account) {
		return accountMapper.selectList(account);
	}

}
